package net.opentsdb.tsd;

import org.jboss.netty.handler.codec.http.HttpResponseStatus;

/**
 * @author Hujf
 * @title: BadRequestException
 * @date 2021-09-23 15:53
 * @description: http 异常处理类
 */
public final class BadRequestException extends RuntimeException{

    /** The HTTP status code to return to the user
     * @since 2.0 */
    private final HttpResponseStatus status;

    /** An optional, detailed error message
     * @since 2.0 */
    private final String details;
    public BadRequestException(final HttpResponseStatus status, String message, String details) {
        super(message);
        this.status = status;
        this.details = details;
    }

    public BadRequestException( String message) {
        this(HttpResponseStatus.BAD_REQUEST,message,"");
    }

    public final HttpResponseStatus getStatus(){
        return status;
    }
}
